package com.csun.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * @ClassName: RoleRole.java
 * @Description:TODO
 * @author danjinsong danjingsong@dragonwake.cn
 * @date 2017年2月17日下午3:32:15
 * 
 */

@Entity
@Table(name="t_role_role")
@SuppressWarnings("serial")
public class RoleRole implements Serializable{

	private Integer id;										//主键 	id		
	private Role    faRole;									//父角色
	private Role	sonRole;								//子角色
	
	//======================================================//
	public RoleRole(Integer id, Role faRole, Role sonRole) {
		super();
		this.id = id;
		this.faRole = faRole;
		this.sonRole = sonRole;
	}
	
	public RoleRole() {
		super();
	}
	//======================================================//
	@Id
	@GeneratedValue(generator="_native")
	@GenericGenerator(name="_native",strategy="native")
	@Column(name = "id", length=20)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@ManyToOne
	@JoinColumn(name="faRoleId")
	public Role getFaRole() {
		return faRole;
	}
	public void setFaRole(Role faRole) {
		this.faRole = faRole;
	}
	@ManyToOne
	@JoinColumn(name="sonRoleId")
	public Role getSonRole() {
		return sonRole;
	}
	public void setSonRole(Role sonRole) {
		this.sonRole = sonRole;
	}
}
